;
(function() {
	var midEvent = require("./index");
	var emailSender = require("../core/_include/email");
	var smsSender = require("../core/_include/sms");
	midEvent.on("bina.first_recommender.get_acc", function(bus_id, buyer_id, recommender_id, first_acc, goods_info) {
		var bus = midEvent.Class.Bus.get(bus_id);
		var buyer = midEvent.Class.User.get(buyer_id);
		var recommender = midEvent.Class.User.get(recommender_id);
		console.log("recommender mobile_phone:", recommender.info.mobile_phone);
		if (recommender.info.mobile_phone) {
			smsSender.send(recommender.info.mobile_phone,
				"点纳科技，用户“{name}”在“{title}”购买“{goods_name}”商品，您获得了返利：￥{money}".format({
					name: buyer.info.name,
					title: bus.info.title,
					goods_name: goods_info.goods_name,
					money: first_acc
				})
			);
		}
	});
}());